package com.caowei.weicimpress.weicimpress;

import java.util.ArrayList;
import java.util.Comparator;

/**
 * Created by caoweiPc on 2014/7/30.
 */
public class MyArrayList<E> extends ArrayList<E> implements MyList<E> {

    @Override
    public boolean contains(Object object,Comparator t) {
        boolean result=super.contains(object);
        if(!result){
            int s = this.size();
            if (object != null) {
                for (int i = 0; i < s; i++) {
                    int compare= t.compare(get(i),object);
                    if(compare==0) {
                        result= true;
                    }
                }
            }
        }
        return result;
    }
}
